import type { NormalOrder } from '@/types/api'

interface FetchOrderListAPIResData {
  code: number
  msg: string
  time: string
  data: {
    total: number
    per_page: string
    current_page: number
    last_page: number
    data: NormalOrder[]
  }
}

interface FetchOrderListAPIParams {
  page: string
  limit: string
  status: string
}

export function fetchOrderListAPI(params: FetchOrderListAPIParams, token: string) {
  return httpInstance.get<FetchOrderListAPIResData, FetchOrderListAPIParams>(
    '/api/order/orderlist',
    { params, headers: { token } },
  )
}
